<?php
namespace App\Http\Controllers\Admin;
use App\Models\BaseModel;
use App\Models\Setting;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/5
 * Time: 14:27
 */
Class SettingController extends BaseController{

    public function __construct(Setting $setting)
    {
        parent::__construct();
        $this->setting = $setting;

    }

    public function getIndex(){
           $flag = 'setting';
           $rows = $this->setting->getAllCache();
           return view('admin.setting.index',compact('flag','rows'));
     }

    /**
     * 设置编辑
     */
     public function postEdit(){
         $res = $this->setting->editSetting(request());
         return redirect()->back()->with('message', $res)->withInput();
     }
}